/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package conn;
import java.sql.*;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Oscar Salazar
 */
public class ListDataBases {
    public String [] listaDB = null;
    public static Vector v = new Vector();
     
    public void showDatabases(Statement conn){
        int i = 0;
        try {
            ResultSet rs = conn.executeQuery("SHOW DATABASES");
            while (rs.next()) {
                this.v.addElement(rs.getString("database"));
                // System.out.println(rs.getString("database"));
                i++;
             }
            conn.close();
        } catch (SQLException ex) {
            Logger.getLogger(ListDataBases.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
    public Vector getDataBases(){
        return this.v;
    }
}
